#include <cstdio>
#include <algorithm>
#include <utility>
#include <cstring>
#include <queue>

using namespace std;

const int maxn=50000, maxm=50;

int a[maxn+1], b[maxm+1], h[maxm+1], ans[maxn+1], f[maxm+1][maxm+1], g[maxm+1][maxm+1], sum[maxn+1], n, m, x, t;

typedef pair<int, int> Ele;

int run(int in, int o, bool flag=false) {
    priority_queue<Ele> hp;
    int cnt=0;
    for (int i=b[o-1]+1; i<=b[o]; i++) {
        hp.push(Ele(a[i], i));
        if (in-x>=0) in-=x;
        else {
            cnt++;
            if (flag) ans[++ans[0]] = hp.top().second;
            in+=hp.top().first;
            hp.pop();
        }
    }
    if (b[o]-b[o-1]-cnt<h[o]) return -1;
    for (; b[o]-b[o-1]-cnt>h[o]; cnt++) {
        if (flag) ans[++ans[0]] = hp.top().second;
        in+=x+hp.top().first;
        hp.pop();
    }
    return in;
}

void print(int p, int q) {
    if (p) {
        if (g[p][q]==q) {
            for (int i=b[p-1]+1; i<=b[p]; i++) ans[++ans[0]] = i;
        } else run(f[p-1][g[p][q]], p, true);

        print(p-1, g[p][q]);
    } else {
        printf("%d\n", ans[0]);
        sort(ans+1, ans+ans[0]+1);
        for (int i=1; i<=ans[0]; i++) printf("%d ", ans[i]);
        printf("\n");
    }
}

int main() {
    freopen("sequence.in", "r", stdin);
    freopen("sequence.out", "w", stdout);

    scanf("%d %d %d %d", &n, &m, &x, &t);
    for (int i=1; i<=n; i++) {
        scanf("%d", a+i);
        sum[i] = sum[i-1]+a[i];
    }
    for (int i=1; i<=m; i++) scanf("%d %d", b+i, h+i);

    memset(f, 255, sizeof f);
    f[0][0] = t;
    for (int i=1; i<=m; i++) {
        for (int j=0; j<=m; j++) {
            if (f[i-1][j]>=0) {
                int t=f[i-1][j]+sum[b[i]]-sum[b[i-1]];
                if (f[i][j]<t) {
                    f[i][j] = t;
                    g[i][j] = j;
                }

                t = run(f[i-1][j], i);
                if (f[i][j+1]<t) {
                    f[i][j+1] = t;
                    g[i][j+1] = j;
                }
            }
        }
    }

    for (int i=m; i>=0; i--) {
        if (f[m][i]>=0) {
            printf("%d\n", i);
            print(m, i);
            break;
        }
    }

    fclose(stdin);
    fclose(stdout);
    return 0;
}
